p=["1/5","2/3","3/4","1/3"]
for i in p:
    print("(1-"+ i +")A * "+i+"B")